<template>
	<view class="form-item">
		<view class="required" v-if="required">*</view>
		<view class="label" :style="{color: labelColor}">
			<view class="label-text">{{label}}</view>
		</view>
		<view class="value">
			<slot></slot>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['label', 'labelColor', 'required'],
		data() {
			return {
				//
			};
		},
		methods: {
			//
		}
	}
</script>

<style lang="scss" scoped>
	.form-item {
		display: flex;
		padding: 26upx 30upx;
		width: 100%;
		background-color: white;
		position: relative;
		font-size: 32upx;
		border-bottom: 1px solid #EEEEEE;
		
		.required {
			color: rgb(235, 9, 9);
			position: absolute;
			font-size: 22upx;
			left: 13upx;
			font-family: Helvetica Neue, Helvetica, sans-serif;
			top: 50%;
			transform: translateY(-50%);
			-webkit-transform: translateY(-50%);
		}

		.label {
			min-width: 140rpx;
			padding-right: 12upx;
		}
		
		.value {
			flex: 1;
		}
	}
</style>
